### Function Description

Query job instance list (execution history)

### Request Parameters

#### Interface parameters

| Fields            | Type   | Required | Description                                                                                                                                                                                                                          |
|-------------------|--------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| bk_scope_type     | string | yes      | Resource scope type. Optional values: biz - Business，biz_set - Business Set                                                                                                                                                          |
| bk_scope_id       | string | yes      | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID                                                                                                                                          |
| bk_biz_id         | long   | yes      | Deprecated. Business ID. This field has been deprecated and replaced by the field bk_scope_type+bk_scope_id                                                                                                                          |
| create_time_start | long   | yes      | Creation time start, Unix timestamp, in milliseconds                                                                                                                                                                                 |
| create_time_end   | long   | yes      | Creation time end, Unix timestamp, in milliseconds                                                                                                                                                                                   |
| job_instance_id   | long   | no       | Task instance ID. If job_instance_id is in or out, other query criteria are ignored                                                                                                                                                  |
| job_cron_id       | long   | no       | Cron Job ID                                                                                                                                                                                                                          |
| operator          | string | no       | Executor, accurate match                                                                                                                                                                                                             |
| name              | string | no       | Task name, fuzzy match                                                                                                                                                                                                               |
| launch_mode       | int    | no       | Launch mode. 1 - Web UI, 2 - API, 3 - Cron Job                                                                                                                                                                                       |
| type              | int    | no       | Task type. 0 - Job Execution, 1 - Script Execution, 2 - File Transfer                                                                                                                                                                |
| status            | int    | no       | Job status code. 1 - Pending; 2 - Running 3 - Successful; 4 - Failed; 5 - Skipped; 6 - Ignore Error; 7 - Waiting; 8 - Terminated; 9 - Abnormal; 10 - Terminating; 11 - Terminate Success; 13 - Termination Confirmed; 14 - Abandoned |
| ip                | string | no       | Execute target server IP for accurate matching                                                                                                                                                                                       |
| start             | int    | no       | Start position of paging record, default 0                                                                                                                                                                                           |
| length            | int    | no       | The maximum number of records returned in a single time is 1000 at most, default 20                                                                                                                                                  |

### Example of request

- GET

```json
/api/v3/get_job_instance_list?bk_scope_type=biz&bk_scope_id=1&type=0&launch_mode=1&status=3&operator=admin&name=test&create_time_start=1546272000000&create_time_end=1577807999999&start=0&length=20
```

### Example of responses

```json
{
    "result": true,
    "code": 0,
    "data": {
        "data": [
            {
                "bk_scope_type": "biz",
                "bk_scope_id": "1",
                "id": 100,
                "job_template_id": 1,
                "job_plan_id": 1,
                "name": "test",
                "operator": "admin",
                "create_time": 1546272000000,
                "start_time": 1546272000000,
                "end_time": 1546272001000,
                "total_time": 1000,
                "launch_mode": 1,
                "task_status": 3,
                "task_type": 0
            }
        ],
        "start": 0,
        "length": 20,
        "total": 1
    },
    "job_request_id": "xxx"
}
```

### Response Description

{% include '_generic_response.md.j2' %}

#### data

{% include '_generic_response_page_data.md.j2' %}

##### data.data

| Fields          | Type   | Never null | Description                                                                                                                                                                                                                          |
|-----------------|--------|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| bk_scope_type   | string | yes        | Resource scope type. Optional values: biz - Business，biz_set - Business Set                                                                                                                                                          |
| bk_scope_id     | string | yes        | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID                                                                                                                                          |
| id              | long   | yes        | Job Plan ID                                                                                                                                                                                                                          |
| job_template_id | long   | yes        | Job Template ID, which has a value when the task is Job Plan                                                                                                                                                                         |
| job_plan_id     | long   | yes        | Job Plan ID, which has a value when the task is a Job Plan                                                                                                                                                                           |
| name            | string | yes        | Task name                                                                                                                                                                                                                            |
| operator        | string | yes        | Operator                                                                                                                                                                                                                             |
| create_time     | long   | yes        | Creation time, Unix timestamp, in milliseconds                                                                                                                                                                                       |
| status          | int    | yes        | Job status code. 1 - Pending; 2 - Running 3 - Successful; 4 - Failed; 5 - Skipped; 6 - Ignore Error; 7 - Waiting; 8 - Terminated; 9 - Abnormal; 10 - Terminating; 11 - Terminate Success; 13 - Termination Confirmed; 14 - Abandoned |
| type            | int    | yes        | Task type. 0 - Plan execution, 1 - Script execution, 2 - File distribution                                                                                                                                                           |
| launch_mode     | int    | yes        | Launch mode. 1 - Web UI, 2 - API, 3 - Cron Job                                                                                                                                                                                       |
| start_time      | long   | no         | Task start time, Unix timestamp, in milliseconds                                                                                                                                                                                     |
| end_time        | long   | no         | Task end time, Unix timestamp, in milliseconds                                                                                                                                                                                       |
| total_time      | long   | no         | Task execution time, Unix timestamp, in milliseconds                                                                                                                                                                                 |
